<?php $id="form_".uniqid();?>
<table id="<?php echo $id;?>"></table>
<script>
    $("#<?php echo $id;?>").DataSource({url:'cash/get_income_list',
        fields:[[
            {field:'level',      title:'层级',  align:'center',      width:80,sortable:true},
            {field:'order_no',      title:'订单号 ', align:'center',width:130, sortable:false},
            {field:'username',  title:'会员帐号', align:'center',  width:80, sortable:true},
            {field:'income_info',title:'存款金额', align:'center',   width:180,  sortable:true, formatter:function(v, r) {
                return '存入金额：'+r.income+'<br/>存款/其他優惠：'+r.discount;
            }},
            {field:'income_total',title:'存入总额', align:'center',     width:190,  sortable:true, formatter:function(v, r) {
                return '存入总额：'+r.income_total;
            }},
            {field:'status',    title:'状态', align:'center',     width:150,  sortable:true,formatter:function(v, r) {
                var str = '';
                if (r.status == '1') {
                    str += '<span style="color:green;">已取消</span>&nbsp;';
                } else if (r.status == '2') {
                    str += '<span style="color:red;">未支付</span>&nbsp;';
                } else {
                    str += '<span>已支付</span>&nbsp;';
                }

                return str;
            }},
            {field:'pay_type', title:'存入银行帐户',align:'center',      width:200,  sortable:true,formatter:function(v, r) {
                return r.pay_type+'（ID：'+r.pay_type_id+'）';
            }},
            {field:'is_first',   title:'首存', align:'center', width:80,  sortable:true,formatter:function(v, r) {
                return r.is_first=='1' ? '是' : '否';
            }},
            {field:'operator',  title:'操作者', align:'center',      width:50,  sortable:true},
            {field:'datetime',title:'操纵者',align:'center',width:200,  sortable:true, formatter:function(v, r) {
                return '系统时间：'+r.create_time+'<br/>操作時間：'+r.operate_time;
            }},
        ]], tools:[
            {instant:false},
            // {text:'导出',iconCls:'icon-large-chart',handler:function(){
            //     var params=$('#<?php echo $id?>').DataSource('queryParams');
            //     Core.Export(params,'cash/export');
            // }},
            {type:'combobox',text:'状态',width:100,name:'verify_status',value:'', items:'<option value="">全部</option><option value="1">未处理</option><option value="1">已确认</option><option value="2">已取消</option><option value="3">有优惠</option><option value="4">无优惠</option>'},
            
            {type:'datebox', text:'日期',   width:100,name:'qaddtime'},
            {type:'datebox', text:'-',     width:100,name:'zaddtime'},
            {type:'textbox', text:'金额',   width:50,name:'qaddtime'},
            {type:'textbox', text:'-',     width:50,name:'zaddtime'},
            {type:'combobox',text:'入款来源',width:100,name:'verify_status',value:'', items:'<option value="">全部</option><option value="1">PC端</option><option value="1">WAP端</option>'},
            {type:'combobox',text:'入款商户',width:100,name:'verify_status',value:'', items:'<option value="">全部</option><option value="1">64455333333333</option><option value="1">64455333333333</option>'},
            {type:'textbox', text:'账号', width:100,name:'username'},
            {type:'textbox', text:'订单号', width:100,name:'username'},
            {type:'combobox',text:'每月显示',width:100,name:'verify_status',value:'', items:'<option value="">50</option><option value="1">100</option><option value="1">150</option><option value="1">200</option><option value="1">250</option><option value="1">300</option>'},
            {text:"搜索", iconCls:"icon-search", handler:function(){
                $('#<?php echo $id?>').DataSource('search');
            }},
            {text:"监控", color:'red',handler:function(){
                $('#<?php echo $id?>').DataSource('search');
            }},
            {type:'label', text:'', html:'<input type="radio" value="1" name="ls">&nbsp;铃声1&nbsp;&nbsp;', width:50},
            {type:'label', text:'铃声1', html:'<input type="radio" value="2" name="ls">&nbsp;铃声2&nbsp;', width:50},
            {text:'根据每个客服管理帐号自定义铃声',handler:function(){
                Core.dialog('自定义铃声', 'cash/ring_setting', function(){}, true, '340px');
            }},
            '-'
        ],
        footer:true,
        checkbox:false,
        success:function(){

        }
    });
</script>